<style lang="scss" scoped>

.RMdoctor {
  dl {
    display: flex;
    padding: 10px;

    dt {
      width: 50px;
      height: 100px;
      img {
        width: 50px;
        height: 50px;
      }
      margin: 0 10px;
    }
    dd {
      .name {
        font-size: 10px;
        font-weight: 800;
        display: flex;
        justify-content: space-between;
        align-items: center;
      }
      div {
        width: 100%;
        height: 30px;
        font-size: 15px;
      }
    }
  }
}
</style>

<template>
  <div
          v-for="(item, index) in SearchDoctorData.slice(0, 14)"
          :key="index"
          class="RMdoctor"
        >
          <dl>
            <dt>
              <img
                :src="item.doctorimage"
                alt=""
                style="width: 50px; height: 50px"
              />
            </dt>
            <dd>
              <div class="name">
                <div>{{ item.doctorname }}</div>
                <div style="font-size: 15px">{{ item.doctorstate }}</div>
                <div style="position: absolute;right: -290px;">
                  <van-button
                    round
                    type="success"
                    style="width: 80px; height: 35px"
                    
                    >去挂号</van-button
                  >
                </div>
              </div>

              <div style="font-size: 14px">{{ item.doctoradministre }}</div>
              <div>
                <van-text-ellipsis :content="item.doctordescword" rows="2"/>
              </div>
            </dd>
          </dl>
        </div>
   
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import axios from 'axios'

import type { bookStata, doctorState, socoState } from '@/interface'
import { useRoute, useRouter } from 'vue-router'
const router = useRouter()
const loading = ref(true)
const finished = ref(true)
const onLoad = () => {}
const SearchBookData = ref<bookStata[]>([])
const SearchDoctorData = ref<doctorState[]>([])
const SearchSocoData = ref<socoState[]>([])
const searchValue = ref('')

onMounted(() => {

  axios
    .get('/api/search', {
      params: {
        pageCode: 1,
        pageSize: 10,
        searchValue: searchValue.value,
      },
    })
    .then(res => {
      const { data } = res.data
      console.log(data)
      SearchBookData.value = data.book
      SearchDoctorData.value = data.doctor
      SearchSocoData.value = data.soco
    })
})
</script>
